<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sapfree.core.db.RecordSet"%>
<%@ page import="net.sapfree.core.db.Record"%>
<%
String path = request.getContextPath();
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="login,regist second">
<meta http-equiv="description" content="This is professionalmodule regist page">
<title>我的飞客-注册-项目经验</title>
<link href="<%=path%>/include/styleBase/css/ostable.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/leftPage.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/styleBase.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/messageType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/exchangeType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/userType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/headfoot.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/fontStyle.css" rel="stylesheet"></link>


<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 20px;
	margin-right: 0px;
	margin-bottom: 0px;
}


body,div { 
font-family:verdana; 
line-height:100%; 
font-size:10pt; 
} 
input { 
width:320px; 
} 
h1 { 
text-align:center; 
font-size:2.2em; 
} 
#companyselect { 
border:1px solid #000; 
}
.des { 
width:500px; 
background-color:lightyellow; 
border:1px solid #555; 
padding:25px; 
margin-top:25px; 
} 
.mouseover { 
color:#ffffff; 
background-color:highlight; 
width:100%; 
cursor:default; 
} 
.mouseout { 
color:#000; 
width:100%; 
background-color:#ffffff; 
cursor:default; 
} 
#projectselect { 
border:1px solid #000; 
}
.des { 
width:500px; 
background-color:lightyellow; 
border:1px solid #555; 
padding:25px; 
margin-top:25px; 
} 
.mouseover { 
color:#ffffff; 
background-color:highlight; 
width:100%; 
cursor:default; 
} 
.mouseout { 
color:#000; 
width:100%; 
background-color:#ffffff; 
cursor:default; 
} 

-->
</style>

<%
String personuuid = (request.getAttribute("personuuid")==null)?"":request.getAttribute("personuuid").toString();
String projectnames = (request.getAttribute("projectnames")==null)?"":request.getAttribute("projectnames").toString();
String companynames = (request.getAttribute("companynames")==null)?"":request.getAttribute("companynames").toString();

RecordSet projectset = (request.getAttribute("projectset")==null)?null:(RecordSet)request.getAttribute("projectset");
%>
</head>
<body>
<form name="frm" method="post">
<input type="hidden" name="personuuid" value="<%=personuuid%>">
<table border="0" cellspacing="20" cellpadding="0" bgcolor="#CCCCCC" width="1000" align="center">
<tr>
		<td width="958" height="200" bgcolor="#FFFFFF" valign="top">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
        	<tr>
            	<td width="50%" align="center">
		        <img src="<%=path%>/images/logo.jpg" border="0">                </td>
                <td width="50%">
              	</td>
          	</tr>
            <tr>
            	<td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="98%" align="center"><tr id="module1" style="display:block"><td height="40" align="left"><table border="0" cellpadding="0" cellspacing="0" width="98%" align="center">
                  <tr>
                    <td colspan="6" height="20"></td>
                  </tr>
                  <tr>
                    <td align="CENTER" height="40" colspan="8"><table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                        <tr>
                          <td class="tip">填写您的项目经验，网站将根据您的输入，为您寻找具有相同项目经验的群和属于该群的好友并为您生成简历：<span class="orangeNormal14" style="cursor:hand;" onClick="_showModule();"></span></td>
                        </tr>
                    </table></td>
                  </tr>
                  
                  <%
				  int projectcount = 0;
				  if(projectset!=null){
				  	for(int p=0;p<projectset.size();p++){
						projectcount++;
						Record projectrecord = (Record)projectset.get(p);
				  %>
                  	<tr>
                   	  <td height="40" colspan="6" align="left">
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        	<tr>
                        	  <td width="90" height="30" align="right" class="blueBold14">项目时间：<input type="hidden" name="project" value="<%=p%>"></td>
                        	  <td width="180" align="left">
                              <input type="text" name="PROJECT<%=p%>_PPE_STARTTIME" class="textInput" style="width:80px;" id="PROJECT<%=p%>_PPE_STARTTIME" value="<%=projectrecord.getString("PPE_STARTTIME")%>"> - 
                              <input type="text" name="PROJECT<%=p%>_PPE_ENDTIME" class="textInput" style="width:80px;" id="PROJECT<%=p%>_PPE_ENDTIME" value="<%=projectrecord.getString("PPE_ENDTIME")%>">                              </td>
                        	  <td width="90" align="right" class="blueBold14">项目名称：</td>
                        	  <td width="200"><input type="text" name="PROJECT<%=p%>_PPE_PROJECTNAME" class="textInput" style="width:200px;" onKeyUp="jsProjectInstance.handleEvent(this.value,'PROJECT<%=p%>_PPE_PROJECTNAME',event)" id="PROJECT<%=p%>_PPE_PROJECTNAME" value="<%=projectrecord.getString("PPE_PROJECTNAME")%>"></td>
                        	  <td width="120" align="right" class="blueBold14">直接签约公司：</td>
                        	  <td width="200"><input type="text" name="PROJECT<%=p%>_PPE_CONTRACTCOMPANYNAME" class="textInput" style="width:200px;" onKeyUp="jsCompanyInstance.handleEvent(this.value,'PROJECT<%=p%>_PPE_CONTRACTCOMPANYNAME',event)" id="PROJECT<%=p%>_PPE_CONTRACTCOMPANYNAME" value="<%=projectrecord.getString("PPE_CONTRACTCOMPANYNAME")%>"></td>
                        	  <td width="10"></td>
                      	  </tr>
                        	
                            <tr><td height="20" colspan="6"><hr size="1" color="#999999" style="border-bottom-style:dotted;" width="98%" align="center"></td></tr>
                      </table>                   	  </td>
                    </tr>
                  <%
					}
				  }
				  %>
                  
                  <%
				  int hascount = projectcount;
				  int projectshowcount = hascount;
				  if(projectshowcount<5){
				  	projectshowcount = 5;
				  }
				  String firstendtime = "";
				  for(int pcount=hascount;pcount<projectshowcount;pcount++){
				  	System.out.println("hascount="+hascount+" projectshowcount="+projectshowcount+" pcount="+pcount);
				  	projectcount++;
					firstendtime = "";
					if(pcount==0){
						//第一次注册，已注册的项目经验数为0，默认显示结束时间为至今
						firstendtime = "至今";
					}
				  %>
                  <tr>
                   	  <td height="40" colspan="6" align="left">
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        	<tr>
                        	  <td width="90" height="30" align="right" class="blueBold14">项目时间：<input type="hidden" name="project" value="<%=pcount%>"></td>
                        	  <td width="180">
                       	   	   <input type="text" name="PROJECT<%=pcount%>_PPE_STARTTIME" class="textInput" style="width:80px;" id="PROJECT<%=pcount%>_PPE_STARTTIME" onChange="_getPreDate('PROJECT<%=pcount%>_PPE_STARTTIME','PROJECT<%=pcount+1%>_PPE_STARTTIME')"> 
                       	   	   -                           	   	
                       	   	   <input type="text" name="PROJECT<%=pcount%>_PPE_ENDTIME" class="textInput" style="width:80px;" id="PROJECT<%=pcount%>_PPE_ENDTIME" value="<%=firstendtime%>"></td>
                        	  <td width="90" align="right" class="blueBold14">项目名称：</td>
                        	  <td width="200"><input type="text" name="PROJECT<%=pcount%>_PPE_PROJECTNAME" class="textInput" style="width:200px;" onKeyUp="jsProjectInstance.handleEvent(this.value,'PROJECT<%=pcount%>_PPE_PROJECTNAME',event)" id="PROJECT<%=pcount%>_PPE_PROJECTNAME"></td>
                        	  <td width="120" align="right" class="blueBold14">直接签约公司：</td>
                        	  <td width="200"><input type="text" name="PROJECT<%=pcount%>_PPE_CONTRACTCOMPANYNAME" class="textInput" style="width:200px;" onKeyUp="jsCompanyInstance.handleEvent(this.value,'PROJECT<%=pcount%>_PPE_CONTRACTCOMPANYNAME',event)" id="PROJECT<%=pcount%>_PPE_CONTRACTCOMPANYNAME"></td>
                        	  <td width="7"></td>
                      	  </tr>
                        	
                            <tr><td height="20" colspan="6"><hr size="1" color="#999999" style="border-bottom-style:dotted;" width="98%" align="center"></td></tr>
                      </table>                   	  </td>
                    </tr>
                    
                    
                  
                    <%
					}
					%>
                    
                  <tr>
                    <td height="40" colspan="6" align="center"><table border="0" cellpadding="0" cellspacing="0" width="257">
                        <tr>
                          <td width="128" align="center"><table border="0" cellpadding="0" cellspacing="0" width="87%">
                              <tr>
                                <td width="101" height="30" bgcolor="f6891f" align="center" style="cursor:hand;"><a href="#" onClick="_pre()"><span style="color:#FFFFFF; font-weight:bold; font-size:14px;">＜＜上一页</span></a></td>
                              </tr>
                          </table></td>
                          <td width="41">&nbsp;</td>
                          <td width="112" height="30" bgcolor="f6891f" align="center" style="cursor:hand;"><a href="#" onClick="_next()"><span style="color:#FFFFFF; font-weight:bold; font-size:14px;">下一页 ＞＞</span></a></td>
                        </tr>
                    </table></td>
                    <td width="1%" height="40" align="center"></td>
                  </tr>
                  <tr>
                    <td height="30" colspan="6" class="orangeNormal14" align="right"><a href="resumeview1.html">+简历预览</a>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td></td>
                    <td height="20"></td>
                  </tr>
                </table></td>
                    </tr>
            	</table>
              </td>
            </tr>
        </table>
        </td> 
  </tr>
   
</table>
<br>
<br>
<br>
<div id="projectselect"></div>
<div id="companyselect"></div>
</form>
</body>

</html>

<script type="text/javascript" src="../include/js/autoselect.js"></script>
<script language="javascript">
var checkSubmitFlg = false;   
function checkSubmit() {   
	if (checkSubmitFlg == true) {   
		return false;   
	}   
	checkSubmitFlg = true;   
	return true;   
}   
document.ondblclick = function docondblclick() {   
	window.event.returnValue = false;   
}   
document.onclick = function doconclick() {   
	if (checkSubmitFlg) {   
		window.event.returnValue = false;   
	}   
}   
</script>
<script language="javascript">
<!--
var jsProjectInstance = new jsAuto("jsProjectInstance","projectselect");
jsProjectInstance.item("<%=projectnames%>");

var jsCompanyInstance = new jsAuto("jsCompanyInstance","companyselect");
jsCompanyInstance.item("<%=companynames%>");
//-->
</script>

<script>
var tempRow=0;
var maxRows=0;
function insertRows(module){
	var inserttable = document.getElementById("professionalmodule");
	 tempRow=inserttable.rows.length-1;
	 maxRows=tempRow;
	 tempRow=tempRow+1;
	 var Rows=inserttable.rows;//类似数组的Rows
	 var newRow=inserttable.insertRow(inserttable.rows.length);//插入新的一行
	 var Cells=newRow.cells;//类似数组的Cells
	 for (i=0;i<6;i++)//每行的6列数据
	 {
		  var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
		  newCell.align="center";
		   switch (i)
		   {
		   		case 0: newCell.innerHTML="<td align=\"center\" class=\"blueBold14\">&nbsp;</td>";break;
				case 1: newCell.innerHTML="<td align='center' height='40' class='blueBold14'>"+module+"                    <input type='hidden' name='module' value='"+module+"'></td>";break;
				case 2: newCell.innerHTML="<td height='40' align='center'><input name='free_"+module+"' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 3: newCell.innerHTML="<td height='40' align='center'><input name='waibu_"+module+"' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 4: newCell.innerHTML="<td height='40' align='center'><input name='neibu_"+module+"' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 5: newCell.innerHTML="<td align=\"center\" class=\"blueBold14\">&nbsp;</td>";break;
		   }
	 }
	 maxRows+=1;
}
function delTableRow(rowNum){
if (table1.rows.length >rowNum){
table1.deleteRow(rowNum);
}
}

function _next(){
	frm.action="<%=request.getContextPath()%>/regist/registservlet?method=registProject";
	frm.submit();
}

function _pre(){
	frm.action="<%=request.getContextPath()%>/regist/registservlet?method=setModule";
	frm.submit();
}

function _getPreDate(obj,objnext){
	var startdate = document.getElementById(obj).value;
	alert(startdate);
	var datearray = new Array();
	datearray = startdate.split('-');
	
	var intyear = parseInt(datearray[0]);
	var intmonth = parseInt(datearray[1]);
	
	var setmonth;
	var setyear;
	if(intmonth>1){
		setmonth = intmonth -1;
		setyear = intyear;
	}else{
		setmonth = 12;
		setyear = intyear-1;
	}
	alert(setyear+"-"+setmonth);
	document.getElementById(objnext).value=setyear+"-"+setmonth;
	
}



	function goPage(url){
		window.parent.$("#mainFrame").attr("src",url);
	}
	function _showModule(){
		document.getElementById("modulesel").style.display="block";
	}
	function _closeModule(){
		document.getElementById("modulesel").style.display="none";
	}
	function _showModuleLine(i){
		document.getElementById("moduletitle").style.display="block";
		document.getElementById("module"+i).style.display="block";
	}
	
	function _hideModule(i){
		document.getElementById("module"+i).style.display="none";
	}
	
	function _showArea(){
		document.getElementById("areasel").style.display="block";
	}
	function _closeArea(){
		document.getElementById("areasel").style.display="none";
	}
	function _showAreaLine(i){
		document.getElementById("areatitle").style.display="block";
		document.getElementById("area"+i).style.display="block";
	}
	
	function _hideArea(i){
		document.getElementById("area"+i).style.display="none";
	}
</script>
